using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.SceneManagement;

public class startInput : MonoBehaviour
{
    public InputAction KeyBoardAnyAction;
    public InputAction TouchAction;
    private void OnEnable()
    {

        KeyBoardAnyAction.Enable();

        TouchAction.Enable();
        KeyBoardAnyAction.performed += OnKeyBoardAnykey;
        TouchAction.performed += OnTouchAnykey;
    }
    private void OnDisable()
    {
        KeyBoardAnyAction.performed -= OnKeyBoardAnykey;
        TouchAction.performed -= OnTouchAnykey;
        KeyBoardAnyAction.Disable();
        TouchAction.Disable();

    }

    public void OnKeyBoardAnykey(InputAction.CallbackContext context)
    {
        Debug.Log("KeyBoard");
        TouchDect.IsTouch = false;
        SceneManager.LoadScene("level1");
    }
    public void OnTouchAnykey(InputAction.CallbackContext context)
    {
        TouchDect.IsTouch  = true;
        Debug.Log("Touch");
        SceneManager.LoadScene("level1");
    }
}
